package com.zengqingfa.springboot.validation.demo.entity;

import lombok.Data;
import lombok.experimental.Delegate;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;

/**
 * @fileName: ValidationList
 * @author: zengqf3
 * @date: 2020-10-6 19:12
 * @description:
 */
@Data
public class ValidationList<E> implements List<E> {

    @Delegate
    @Valid
    public List<E> list = new ArrayList<>();

    /**
     * 一定要记得重写toString方法
     * @return
     */
    @Override
    public String toString() {
        return list.toString();
    }
}
